#!/usr/bin/env python
import sys
import class_set
import helper

class FollowRecommendationMapper(helper.MapperHelper):
    def mapper(self):
        for line in sys.stdin:
            left, right = self.loader(line)
            node = class_set.UserNode()
            node.init(right)
            if node.getType() != 'delstars':
                self.allocator(left, self.join(node.getId(), class_set.RecomTag('1'))) # follow list
                self.allocator(node.getId(), self.join(left, class_set.RecomTag('2'))) # the reverse is fan list
            else:
                pass

def main():
    fm = FollowRecommendationMapper()
    fm.mapper()

if __name__ == '__main__':
    main()
